<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="renderer" content="webkit">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">
  <title>RippleTek</title>
  <meta content="authenticity_token" name="csrf-param" />
<meta content="SJbpwJqURikDQS5uU7R6QXNrAFike812HpGK1mNf+EY=" name="csrf-token" />
  <link rel="shortcut icon" href="../v1/favicon.ico" type="image/x-icon" />
  <link rel="icon" href="../v1/favicon.ico" sizes="32x32" />
  <link rel="icon" href="../v1/favicon.ico" sizes="64x64" />
  <link rel="icon" href="../v1/favicon.ico" sizes="128x128" />
  <link href="../assets/rptk_css/rptk-cloud.css" rel="stylesheet" />
  <script type="text/javascript" src="../assets/rptk_js/jquery-1.11.1.min.js"></script>
  <script type="text/javascript" src="../assets/jquery_ujs.js"></script>
  <script type="text/javascript" src="../assets/rptk_js/plugin.js"></script>
  <script type="text/javascript" src="../assets/rptk_js/zh_CN.js"></script>
  <script type="text/javascript" src="../assets/rptk_js/rptk-cloud.js"></script>

  
  <script src="../assets/distpicker.data.js"></script>
<script src="../assets/distpicker.js"></script>

  <!--[if lt IE 9]>
    <script src="../assets/rptk_js/html5shiv.min.js"></script>
    <script src="../assets/rptk_js/respond.min.js"></script>
  <![endif]-->
</head>
<body>




  <div class="navbar navbar-default" role="navigation">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="http://cloud.rippletek.com/">RippleTek 云平台服务</a>
      </div>
      <div class="collapse navbar-collapse" id="navbar-collapse">
          <div class="navbar-right">
            <p class="navbar-text mg-rt">已经有账号了？</p>
            <a href=http://cloud.rippletek.com/users/sign_in class="btn btn-primary navbar-btn navbar-btn-mw">登陆</a>
          </div>
      </div>  
    </div>
  </div>

  <div class="container-fluid">

        <div class="container rptk-cloud-register">
    <div class="register-header">
      <h2>创建一个新账号</h2>
      <h4>通过云端账号您能很方便的查看数据，管理网络</h4>
    </div>
    <div class="register-tabs cf">
      <button type="button" class="btn btn-primary" id="regway">以个人名义注册账号</button>
    </div>
    <div class="register-body page-register-content">
      <form accept-charset="UTF-8" action="/users" class="row form-horizontal form-register" id="new_user" method="post"><div style="display:none"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="SJbpwJqURikDQS5uU7R6QXNrAFike812HpGK1mNf+EY=" /></div>
        <div class="form-group">
          <label for="" class="col-sm-1 control-label">用户名：</label>
          <div class="col-sm-4">
            <input autofocus="autofocus" class="form-control input-df" id="user_name" name="user[name]" type="text" value="" />
          </div>
          <div class="col-sm-6 control-tips">
            <span class="text-red">*</span> 请输入1-16位数字、字母或下划线
          </div>
        </div>
        <div class="form-group">
          <label for="" class="col-sm-1 control-label">邮箱：</label>
          <div class="col-sm-4">
            <input class="form-control input-df" id="user_email" name="user[email]" type="email" value="" />
          </div>
          <div class="col-sm-6 control-tips">
            <span class="text-red">*</span> 请输入正确的邮箱地址
          </div>
        </div>
        <div class="form-group">
          <label for="" class="col-sm-1 control-label">密码：</label>
          <div class="col-sm-4">
            <input autocomplete="off" class="form-control input-df" data-rule="密码: required;password;" id="user_password" name="user[password]" type="password" />
          </div>
          <div class="col-sm-6 control-tips">
            <span class="text-red">*</span> 密码长度6-30位
          </div>
        </div>
        <div class="form-group">
          <label for="" class="col-sm-1 control-label">密码确认：</label>
          <div class="col-sm-4">
            <input autocomplete="off" class="form-control input-df" data-rule="确认密码: required;match(user[password]);" id="user_password_confirmation" name="user[password_confirmation]" type="password" />
          </div>
          <div class="col-sm-6 control-tips">
            <span class="text-red">*</span> 请再次确认密码
          </div>
        </div>
        <div class="form-group">
          <label for="" class="col-sm-1 control-label">联系人：</label>
          <div class="col-sm-4">
            <input class="form-control input-df" data-rule="联系人:required;length[1~16]" id="user_nick_name" name="user[nick_name]" type="text" value="" />
          </div>
          <div class="col-sm-6 control-tips">
            <span class="text-red">*</span> 请填写联系人名称，1-16字 
          </div>
        </div>
        <div class="form-group">
          <label for="" class="col-sm-1 control-label">手机号：</label>
          <div class="col-sm-4">
            <input class="form-control input-df" data-rule="手机号:required;mobile" id="user_mobile" name="user[mobile]" type="text" value="" />
          </div>
          <div class="col-sm-6 control-tips">
            <span class="text-red">*</span> 请填写正确的手机号码
          </div>
        </div>
        
        <div class="company-input">
          <input class="input-txt input-df" id="user_agent_info_attributes_category" name="user[agent_info_attributes][category]" type="hidden" value="company" />
          <div class="form-group">
            <label for="" class="col-sm-1 control-label">公司名称：</label>
            <div class="col-sm-4">
              <input class="form-control input-df" data-rule="公司名称:required;length[2~32]" id="user_agent_info_attributes_company_name" name="user[agent_info_attributes][company_name]" type="text" />
            </div>
            <div class="col-sm-6 control-tips">
              <span class="text-red">*</span> 请填写公司名称，2-32字 
            </div>
          </div>
          <div class="form-group">
            <label for="" class="col-sm-1 control-label">城市：</label>
            <div distpicker class="distpicker-select">
              <div class="col-sm-2">
                <select class="form-control input-df" data-province="---- 选择省 ----" id="user_agent_info_attributes_province" name="user[agent_info_attributes][province]"></select>
              </div>
              <div class="col-sm-2">
                <select class="form-control input-df" data-city="---- 选择市 ----" id="user_agent_info_attributes_city" name="user[agent_info_attributes][city]"></select>
              </div>
              <div class="col-sm-2">
                <select class="form-control input-df" data-district="---- 选择区 ----" id="user_agent_info_attributes_district" name="user[agent_info_attributes][district]"></select>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label for="" class="col-sm-1 control-label">详细地址：</label>
            <div class="col-sm-4">
              <input class="form-control input-df" data-rule="详细地址:required;length[2~64]" id="user_agent_info_attributes_street" name="user[agent_info_attributes][street]" type="text" />
            </div>
            <div class="col-sm-6 control-tips">
              <span class="text-red">*</span> 请填写详细地址，2-64字
            </div>
          </div>
        </div>
        <div class="form-group">
          <label for="" class="col-sm-1 control-label">验证码：</label>
          <div class="col-sm-2">
            <input autocomplete="off" class="form-control input-df" id="user_captcha" name="user[captcha]" placeholder="输入验证码" required="required" type="text" value="" /><input id="user_captcha_key" name="user[captcha_key]" type="hidden" value="77b8f381d34550827bd309ad5663a7cb68dcb584" />            
          </div>
          <div class="col-sm-2">
            <a class="captcha" data-remote="true" href="http://cloud.rippletek.com/users/sign_up?url=%2Fsimple_captcha%3Fid%3Dsimple_captcha-77b8f381d34"><img alt="captcha" id="simple_captcha-77b8f381d34" src="../simple_captchacode=77b8f381d34550827bd309ad5663a7cb68dcb584&time=1414141356.jpg" /></a>
          </div>
          <div class="col-sm-4 control-tips">点击图片刷新验证码</div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-1 col-sm-2">
            <button type="submit" class="btn btn-primary btn-df btn-block">立即注册</button>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-1 col-sm-10">
            点击 “立即注册” 即表示您同意 <a href="http://cloud.rippletek.com/regAgreement.html" target="_blank" class="c-4796EE">《新用户注册协议》</a>
          </div>
        </div>
</form>    </div>
  </div>





  </div>

  <footer class="container-fluid">
    <div class="container">
      <a href=http://www.rippletek.com/home/index/help.html>帮助中心</a>
      <a href=http://forum.rippletek.com/forum-47-1.html>问题反馈</a>
      Copyright © 2014 RippleTek All Rights Reserved  蜀ICP备13026025号-1
    </div>
  </footer>

  
<script type="text/javascript">
$(function(){

  $('form').validator({
    rules: {
      usernameRemote: function(element){
        return $.ajax({
          url: '/check_unique/username?value=' + element.value,
          type: 'GET',
          dataType: 'json',
          success: function(d){
            
          }
        });
      },
      emailRemote: function(element){
        return $.ajax({
          url: '/check_unique/email?value=' + element.value,
          type: 'GET',
          dataType: 'json',
          success: function(d){
            
          }
        });
      }
    },
    fields: {
      'user[name]': 'required; username; usernameRemote;',
      'user[email]': 'required; email; emailRemote;'
    }
  });

	/*注册方式切换*/
	$('#regway').click(function() {
		$(this).toggleClass('regway');
		var has_class = $(this).hasClass('regway')
		if(has_class){
    $('.company-input').hide();
      $('#user_agent_info_attributes_category').val('personal');
			$  (this).text('以公司名义注册账号');
		}else{
			$('.company-input').show();
      $('#user_agent_info_attributes_category').val('company');
			$(this).text('以个人名义注册账号');
		}
    });


  $(".page-register-content").on("click", '.captcha',function() {
    var url = $("a.captcha").attr("href");
    if(url.match(/\/users\?/)){
      url = url.replace(/\/users\?/, '/users/sign_up?');
    }

    $.get(url, function(data) {
      var code = $(data).children().attr('src').match(/code=(\w+)/)[1];
      $('#user_captcha_key').val(code);
      $(".captcha").replaceWith(data);
    });
    return false
  });
});
</script>

</body>
</html>

